<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="./lib/vue2.6.10.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="浪起来" @click="lang">
        <input type="button" value="别浪" @click="noLang">
        <h4>{{msg}}</h4>
    </div>
    

    <script>
    var vm = new Vue({
        el:"#app",
        data:{
            msg:'猥琐发育-别浪！！！',
            intervaId : null
        },
        methods: {
            lang(){
                if(this.intervaId != null) return ;
                this.intervaId = setInterval( () => {
                    var start = this.msg.substring(0,1);
                    var end = this.msg.substring(1);
                    this.msg = end + start;
                },300)
            },
            noLang(){
                clearInterval(this.intervaId);
                this.intervaId = null;
            }
        },
    })
    </script>
</body>
</html>